home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 3 / AGA Experience Volume 3 (1997)(NFA - SAdENESS)[!].iso / amiga / classupdate / install_classes < prev    next >
Text File  |  1996-08-27  |  10KB  |  252 lines

  1. ; $VER: Install_ClassAct Update 1.0 (7.5.96)
  2. ; Description: Installer script for ClassAct Class Updates
  3.  
  4. (set cpu (database "cpu"))
  5. (set cpu020 (and (<> cpu "68000") (<> cpu "68010")))
  6. (set v39 (>= (/ (getversion "exec.library" (resident)) 65536) 39))
  7.  
  8. (set #welcome "This program will install the ClassAct shared gadget classes on your system.\n")
  9.  
  10. (complete 0)
  11.  
  12. (if (< (/ (getversion "exec.library" (resident)) 65536) 37)
  13.     (abort "This program requires OS 2.04 or better.")
  14. )
  15.  
  16. (welcome #welcome)
  17.  
  18. ; ---------------------------------------------------------------------------
  19.  
  20. ; ************* PLEASE COPY THIS PROCEDURE ALONG WITH THE STRINGS IT USES 
  21. ; ************* TO THE INSTALLER SCRIPT OF YOUR CLASSACT APPLICATION.
  22. ; ************* IT WILL TAKE CARE OF INSTALLING THE CLASSACT CLASSES YOU
  23. ; ************* PROVIDED WITH YOUR APPLICATION TO THE USER'S SYSTEM.
  24.  
  25. ; ClassAct installation procedure V 1.5 (12.5.96) by Osma Ahvenlampi
  26.  
  27. ; percentage of the size of included ClassAct classes versus the whole
  28. ; distribution (ie. total "complete" percentage after ClassAct is installed)
  29. (set classact-complete 100)
  30.  
  31. ; ClassAct installer scripts
  32. (set #classdest-prompt "Please select the directory where you want the ClassAct classes installed.\n(See help for details)")
  33. (set #classdest-help (cat "ClassAct is a GUI toolkit consisting of shared BOOPSI classes.\n\nSome programs require some or all of the ClassAct classes installed on your system. "
  34.     (if v39 (cat "OS 3.0 has a standard directory for BOOPSI classes, the SYS:Classes directory. It is recommended that you install ClassAct there.")
  35.             (cat "OS 2.0 does not have a standard place for disk resident BOOPSI classes. On OS 3.0 these classes are stored in the SYS:Classes directory. It is recommended that you create this directory and install ClassAct there.\nThis directory must be added in the LIBS: assign. This can be done by placing the command\nAssign >NIL: LIBS: SYS:Classes ADD\nto User-Startup. This installer will do this for you.")
  36.         )
  37.     )
  38. )
  39. (set #classes-020 "Do you want to use the OS 3.0, 020 optimised version of ClassAct?")
  40. (set #help-020 "Some ClassAct libraries have versions optimised for use on 020 or better equipped OS 3.0 or later machines. If your Amiga is such equipped, you should install these. The 68000/2.0 versions will also work, but are slightly slower.")
  41. (set #noclasses-message "The directory you selected for your ClassAct classes is not a part of the LIBS: assign.\n\nIt is necessary to add this assign so that the classes will be found properly.")
  42. (set #creating-dir "Creating directory ")
  43. (set #usbackup-prompt "User-Startup will now be backed up.")
  44. (set #usbackup-help "This installer will next make a modification in User-Startup. Before doing this the old User-Startup will be backed up to S:User-Startup.old")
  45. (set #adding-1 "Adding ")
  46. (set #adding-2 " to LIBS: assign\n")
  47. (set #adding-help "This is necessary so that the custom classes can be found.")
  48. (set #junod-button "It seems you have a late Commodore 'V42' button.gadget installed on your system.\n\nClassAct's button.gadget is far more capable than this gadget, and we recommend that you replace it. The ClassAct button.gadget is backwards compatible to the Commodore gadget. Do you wish to back up the Commodore gadget and replace it with the ClassAct version?")
  49. (set #junod-backed "The Commodore 'V42' button.gadget has been backed up with the name button.gadget.v42.\n\nThe ClassAct button.gadget will be installed in its place.")
  50. (set #junod-kept "The Commodore 'V42' button.gadget was not replaced with the more capable ClassAct version.\n\nPrograms depending on the availability of ClassAct-only features will be likely to work wrong.")
  51. (set #caprefs-message "CAPrefs is a small utility that helps set some user preferences for ClassAct applications. These include the bevel style (Thin/Gadtools/Xen), window backfills, and group label details.\n\nPlease use the ClassAct GUI prefs editor to alter the default settings provided. ClassAct prefs will be installed in your system Prefs drawer.\n\n")
  52. (set #caprefs-startup-1 "Adding the command\n\n")
  53. (set #caprefs-startup-2 "\n\nTo your s:User-Startup.")
  54.  
  55. (procedure install-classact
  56. ; call this procedure to copy the classes included in the Classes directory
  57. ; in your distribution dir.
  58.     (if (exists "Classes") ; The archive contains a ClassAct library update.
  59.     (
  60.         (set comp-dest  (/ (* classact-complete 2) 10))
  61.         (set comp-libs  (/ (* classact-complete 3) 10))
  62.         (set comp-dirs  (/ (* classact-complete 4) 10))
  63.         (set comp-junod (/ (* classact-complete 5) 10))
  64.         (set comp-020   (/ (* classact-complete 6) 10))
  65.         (set comp-gad   (/ (* classact-complete 7) 10))
  66.         (set comp-im    (/ (* classact-complete 8) 10))
  67.         (set comp-prefs (/ (* classact-complete 9) 10))
  68.     
  69.         ; has the user installed ClassAct in CLASSACT: ?
  70.         (set @classact-dest (getassign "CLASSACT" "A"))
  71.         (if (= @classact-dest "") (set @classact-dest "SYS:Classes"))
  72.         
  73.         ; is ClassAct already in SYS:Classes ?
  74.         (if (or (not (exists (tackon @classact-dest "Gadgets/layout.gadget") (noreq)))
  75.                 (= @user-level 2))
  76.             ; no, ask where it should be placed
  77.             (set @classact-dest
  78.                 (askdir
  79.                     (prompt #classdest-prompt)
  80.                     (help #classdest-help)
  81.                     (default @classact-dest)
  82.                     (newpath)
  83.                 )
  84.             )
  85.         )
  86.         
  87.         (complete comp-dest)
  88.         
  89.         (if (<> (run (cat "C/CheckAssign LIBS: " @classact-dest)) 0)
  90.             (
  91.                 (message #noclasses-message)
  92.                 (if (not (exists @classact-dest))
  93.                     (makedir @classact-dest (prompt (cat #creating-dir @classact-dest)))
  94.                 )
  95.                 (set @addassign (cat "Assign >NIL: LIBS: " @classact-dest " ADD\n"))
  96.                 (startup "CLASSACT"
  97.                     (command @addassign)
  98.                     (prompt (cat #adding-1 @classact-dest #adding-2))
  99.                     (help #adding-help)
  100.                 )
  101.                 (run (@addassign))
  102.             )
  103.         )
  104.         
  105.         (complete comp-libs)
  106.         
  107.         (set @classact-gadgets (tackon @classact-dest "Gadgets"))
  108.         (set @classact-images (tackon @classact-dest "Images"))
  109.         
  110.         (if (not (exists @classact-gadgets (noreq)))
  111.             (makedir @classact-images
  112.                 (prompt (cat #creating-dir @classact-gadgets))
  113.             )
  114.         )
  115.         
  116.         (if (not (exists @classact-images (noreq)))
  117.             (makedir @classact-images
  118.                 (prompt (cat #creating-dir @classact-images))
  119.             )
  120.         )
  121.         
  122.         (complete comp-dirs)
  123.         
  124.         (if (exists "SYS:Classes/Gadgets/button.gadget")
  125.             (if (< 41 (/ (getversion "SYS:Classes/Gadgets/button.gadget") 65536))
  126.                 (if (askbool (prompt #junod-button) (help @askbool-help) (default 1))
  127.                     (
  128.                         (rename "SYS:Classes/Gadgets/button.gadget" "SYS:Classes/Gadgets/button.gadget.v42")
  129.                         (message #junod-backed)
  130.                     )
  131.                     (message #junod-kept)
  132.                 )
  133.             )
  134.         )
  135.         
  136.         (complete comp-junod)
  137.         
  138.         (if (exists "Classes/Gadgets/layout.gadget.020")
  139.             (set classes-020 (askbool (prompt #classes-020) (help #help-020) (default (and cpu020 v39))))
  140.             (set classes-020 0)
  141.         )
  142.  
  143.         (complete comp-020)
  144.         
  145.         (foreach "Classes/Gadgets" "#?.gadget"
  146.             (
  147.                 (set thislib (tackon "Classes/Gadgets" @each-name))
  148.                 (if (and classes-020 (exists (cat thislib ".020")))
  149.                     (set thislib (cat thislib ".020"))
  150.                 )
  151. ;          (message (@each-name))
  152.  
  153.                 (copylib (source thislib)
  154.                     (dest @classact-gadgets)
  155.                     (newname @each-name)
  156.                     (prompt (cat #installing @each-name))
  157.                     (help #classdest-help)
  158.                     (optional "force" "askuser")
  159.                 )
  160.             )
  161.         )
  162.         
  163.         (complete comp-gad)
  164.         
  165.         (foreach "Classes/Images" "#?.image"
  166.             (
  167.                 (set thislib (tackon "Classes/Images" @each-name))
  168.                 (if (and classes-020 (exists (cat thislib ".020")))
  169.                     (set thislib (cat thislib ".020"))
  170.                 )
  171. ;          (message (@each-name))
  172.  
  173.                 (copylib (source thislib)
  174.                     (dest @classact-images)
  175.                     (newname @each-name)
  176.                     (prompt (cat #installing @each-name))
  177.                     (help #classdest-help)
  178.                     (optional "force" "askuser")
  179.                 )
  180.             )
  181.         )
  182.         
  183.         (complete comp-im)
  184.  
  185.         (foreach "Classes" "#?.class"
  186.             (
  187.                 (set thislib (tackon "Classes" @each-name))
  188.                 (if (and classes-020 (exists (cat thislib ".020")))
  189.                     (set thislib (cat thislib ".020"))
  190.                 )
  191.                 (copylib (source thislib)
  192.                     (dest @classact-dest)
  193.                     (newname @each-name)
  194.                     (prompt (cat #installing @each-name))
  195.                     (help #classdest-help)
  196.                     (optional "force" "askuser")
  197.                 )
  198.             )
  199.         )
  200.     )
  201.     )
  202.     (if (exists "Prefs/ClassAct") ; The archive contains ClassAct prefs tools
  203.     (
  204.         (message #caprefs-message)
  205.         
  206.         (copylib (source "Prefs/CAPrefs") 
  207.             (dest "C:") 
  208.             (prompt (cat #installing "CAPrefs"))
  209.         )
  210.         (copylib (source "Prefs/ClassAct")
  211.             (dest "SYS:Prefs")
  212.             (prompt (cat #installing "ClassAct Prefs"))
  213.             (infos)
  214.         )
  215.         
  216.         (complete comp-prefs)
  217.         
  218.         (if (not (exists "ENVARC:ClassAct" (noreq)))
  219.             (
  220.                 (makedir "ENVARC:ClassAct"
  221.                     (prompt (cat #creating-dir "ENVARC:ClassAct"))
  222.                 )
  223.                 (textfile (dest "ENVARC:ClassAct/ClassAct")
  224.                     (append "")
  225.                 )
  226.             )
  227.         )
  228.                 
  229.         (set caprefs-cmd "C:CAPrefs >NIL:\n")
  230.         
  231.         (startup "CAPREFS"
  232.             (prompt (cat #caprefs-startup-1 caprefs-cmd #caprefs-startup-2))
  233.             (help #caprefs-message)
  234.             (command caprefs-cmd)
  235.         )
  236.     )
  237.     )
  238.  
  239.     (complete classact-complete)
  240. )
  241.  
  242. ; ************** END OF CLASSACT INSTALL PROCEDURE. COPY THE BLOCK ABOVE
  243. ; ************** TO YOUR CLASSACT APPLICATION INSTALLER.
  244.  
  245. ; ---------------------------------------------------------------------------
  246.  
  247. (install-classact)
  248.  
  249. (set @default-dest @classact-dest)
  250.  
  251. (complete 100)
  252.